import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/pages/home/Home'
import Order from '@/pages/order/Order'
import Discover from '@/pages/discover/Discover'
import Mine from '@/pages/mine/Mine'
import Detail from '@/pages/detail/Detail'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home,
    },
    {
      path: '/order',
      name: 'Order',
      component: Order,
    },
    {
      path: '/discover',
      name: 'Discover',
      component: Discover,
    },
    {
      path: '/mine',
      name: 'Mine',
      component: Mine,
    },
    {
      path: '/detail:id/:name', 
      // 少了这个:id路由过去就是空白页
      name: 'Detail',
      component: Detail,
    },
  ]
})
